from sklearn.datasets import load_breast_cancer
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split

data = load_breast_cancer()
x = data.data
y = data.target
x_train, x_test, y_train, y_test = train_test_split(x, y, train_size=0.7)

dtc = DecisionTreeClassifier(max_depth=5)
dtc.fit(x_train, y_train)
print(f'Training score = {dtc.score(x_train, y_train)}')
print(f'Testing score = {dtc.score(x_test, y_test)}')
